<%@page import="mobi.weq.model.HealthCondition"%>
<%@page import="mobi.weq.dao.HealthConditionDao"%>
<%@page import="mobi.weq.model.User"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Health Condition Setting</title>

<link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.min.css">

<link href="bootstrap-switch-master/dist/css/bootstrap3/bootstrap-switch.min.css" rel="stylesheet" type="text/css">
<link href="jsp/healthConditionSetting.css" rel="stylesheet">



<script src="js/jquery-1.11.1.min.js"></script>
<script src="bootstrap-switch-master/dist/js/bootstrap-switch.min.js"></script>
<style type="text/css">
/* .bootstrap-switch{
	border-radius:15px; 
 }
 
 .bootstrap-switch .bootstrap-switch-handle-off{
 	/* border-radius:0 15px 15px 0; */
 	border-radius:15px; 
 }
 .bootstrap-switch .bootstrap-switch-handle-on {
 	/* border-radius:15px 0 0 15px; */
 	border-radius:15px; 
 }
 */ 
</style>

</head>
<body>
<%
	User user = (User)request.getAttribute("user");
	HealthConditionDao dao = new HealthConditionDao();
	HealthCondition hc = dao.getUserHealthCondition(user);
%>

	<form action="settings" method="post">
		<div><label class="setting-text">Respiratory infections:</label><input type="checkbox" name="respiratory_infections" <%=(hc.isRespiratory_infections()?"checked":"") %>></div>
		<div><label class="setting-text">Lung diseases:</label><input type="checkbox" name="lung_disease" <%=(hc.isLung_disease()?"checked":"") %>></div>
		<div><label class="setting-text">Asthma:</label><input type="checkbox" name="asthma" <%=(hc.isAsthma()?"checked":"") %>></div>
		<div><label class="setting-text">Heart diseases:</label><input type="checkbox" name="heart_disease" <%=(hc.isHeart_disease()?"checked":"") %>></div>
		<div><label class="setting-text">Allergies:</label><input type="checkbox" name="allergies" <%=(hc.isAllergies()?"checked":"") %>></div>
		<button type="submit" class="btn btn-primary">Submit</button>
	</form>
	
	<script type="text/javascript">
	$("form [type='checkbox']").attr("data-on-text","YES").attr("data-off-text","NO").attr("data-off-color","danger").attr("data-on-color","success").bootstrapSwitch();

	</script>		
</body>
</html>